package com.jvm.interpreter.instruction;

import com.jvm.classfile.model.CpInfo;
import com.jvm.interpreter.Frame;
import com.jvm.interpreter.Instruction;

/**
 * @program: diy_simple_jvm
 * @description: istore_2指令
 * @author: CaoYong
 * @create: 2021-07-08 13:56
 **/
public class IStore2Inst implements Instruction {
    @Override
    public void eval(Frame frame) {
//        frame.localVars.put(2, frame.operandStack.pop());
        frame.setInt(2, frame.popInt());
        frame.pc += offset();
    }

    static IStore2Inst parse(java.io.DataInputStream dis, CpInfo[] cp) throws java.io.IOException {
        return new IStore2Inst();
    }
}
